/*------------------------------------------------------
                hou_elearningGEN beta v1.0
Author: xtrung.net@gmail.com
Write On: 04/27/2008
Create On:4/13/2012 11:22:49 AM
------------------------------------------------------*/
using System;
using System.Collections.Generic;
using System.Text;
using System.Reflection;
namespace hou_elearning.Entity
{
    public class LienheEntity
    {
        public LienheEntity()
        {
			m_pk_ilienheid=0;
			m_snoidung="";
			m_dngaygiolienhe=DateTime.Now;
			m_semail="";
        }
		private Int64 m_pk_ilienheid;
		public Int64 PK_iLienheID
		{
			get { return m_pk_ilienheid ; }
			set { m_pk_ilienheid = value; }
		}
		private String m_snoidung;
		public String sNoidung
		{
			get { return m_snoidung ; }
			set { m_snoidung = value; }
		}
		private DateTime m_dngaygiolienhe;
		public DateTime dNgaygiolienhe
		{
			get { return m_dngaygiolienhe ; }
			set { m_dngaygiolienhe = value; }
		}
		private String m_semail;
		public String sEmail
		{
			get { return m_semail ; }
			set { m_semail = value; }
		}

        #region Comparison
        public static List<LienheEntity> Sort(List<LienheEntity> list, String SortExpression, String SortDirection)
        {
            string strComparisonAttrb="COMPARISON_"+SortExpression;
            PropertyInfo propInfo= typeof(LienheEntity).GetProperty(strComparisonAttrb);
            if (propInfo != null)
            {
                list.Sort(propInfo.GetGetMethod().Invoke(null,null) as Comparison<LienheEntity>);
                if (SortDirection == "DESC")
                    list.Reverse();
            }
            return list;
        }
        
		public static Comparison<LienheEntity> COMPARISON_PK_iLienheID
		{
			get
			{
				return delegate(LienheEntity entity,LienheEntity other)
				{
					return entity.PK_iLienheID.CompareTo(other.PK_iLienheID);
				};
			}
		}
		public static Comparison<LienheEntity> COMPARISON_sNoidung
		{
			get
			{
				return delegate(LienheEntity entity,LienheEntity other)
				{
					return entity.sNoidung.CompareTo(other.sNoidung);
				};
			}
		}
		public static Comparison<LienheEntity> COMPARISON_dNgaygiolienhe
		{
			get
			{
				return delegate(LienheEntity entity,LienheEntity other)
				{
					return entity.dNgaygiolienhe.CompareTo(other.dNgaygiolienhe);
				};
			}
		}
		public static Comparison<LienheEntity> COMPARISON_sEmail
		{
			get
			{
				return delegate(LienheEntity entity,LienheEntity other)
				{
					return entity.sEmail.CompareTo(other.sEmail);
				};
			}
		}
        #endregion
    }
}
